package com.yanqu.road.server.logic.recharge;

import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.config.goods.MallInfo;
import com.yanqu.road.entity.enums.eLogMoneyType;
import com.yanqu.road.entity.recharge.RechargeOrder;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.ActivityMallModule;
import com.yanqu.road.server.gameplayer.module.activity.washe.WasheModule;
import com.yanqu.road.server.gameplayer.module.player.CurrencyModule;
import com.yanqu.road.utils.property.PropertyHelper;

public class WasheDirectRmbMallRecharge extends BaseRecharge {

    public WasheDirectRmbMallRecharge(GamePlayer player, MallInfo mallInfo, ActivityInfo activityInfo) {
        super(player, mallInfo, activityInfo);
    }

    @Override
    protected boolean isRepeatedBuy(String orderNo) {
        return player.getModule(ActivityMallModule.class).isOverLimitBuyCount(mallInfo, 1);
    }

    @Override
    protected void repeatedBuyLogic() {

    }

    @Override
    protected String addMall(String orderNo, RechargeOrder rechargeOrder) {
        String rewardStr = mallInfo.getReward();
        player.getModule(CurrencyModule.class).addCurrency(PropertyHelper.parseStringToProperty(mallInfo.getReward()), eLogMoneyType.Recharge, eLogMoneyType.ReChargeGet);
        logger.info("订单: {}, 直购现金礼包购买 瓦舍夺魁 商品: {}", orderNo, mallInfo.getMallId());
        //player.getModule(WasheModule.class).reduceRmbMallTimes(mallInfo.getMallId());
        return rewardStr;
    }

}
